﻿<Page
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
	  xmlns:v="clr-namespace:MovieRental_Presentation.Validation"
	  x:Class="MovieRental_Presentation.NewMovieDialog" 
      d:DesignWidth="900" d:DesignHeight="500"
      mc:Ignorable="d"
      WindowTitle="Movie Rental"
	  MinWidth="900"
	  MinHeight="500" 
      ShowsNavigationUI="False">

	<Grid x:Name="LayoutRoot">
		<Grid x:Name="LayoutRoot_Copy" Background="{StaticResource backgroundBrush}">
			<Border BorderBrush="{StaticResource borderBrush}" BorderThickness="{StaticResource borderThickness}" Margin="8" Padding="{StaticResource borderPadding}" CornerRadius="{StaticResource borderCornerRadius}">
				<Grid Margin="0">
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto" MinHeight="108.57"/>
						<RowDefinition/>
					</Grid.RowDefinitions>
					<TextBlock Margin="8,8,0,0" TextWrapping="Wrap" Text="New Movie" FontSize="{StaticResource dialogGiantTitleTextSize}" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="{StaticResource borderBrush}"/>
					<Button x:Name="backButton" Content="Back" HorizontalAlignment="Right" Width="60" VerticalAlignment="Center" Height="60" Margin="0,0,8,0" Click="backButton_Click"/>
					<Border BorderBrush="{StaticResource borderBrush}" BorderThickness="{StaticResource borderThickness}" Height="3" VerticalAlignment="Bottom"/>
					<Grid Margin="0" Grid.Row="1">
						<Grid.RowDefinitions>
							<RowDefinition Height="*"/>
							<RowDefinition Height="*"/>
							<RowDefinition Height="*"/>
							<RowDefinition Height="*"/>
						</Grid.RowDefinitions>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="250"/>
							<ColumnDefinition/>
						</Grid.ColumnDefinitions>
						<TextBlock Margin="8,0,0,0" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{StaticResource inputBoxBrush}" FontSize="{StaticResource dialogElementFontSize}" Text="Title"/>
						<TextBlock Margin="8,0,0,0" TextWrapping="Wrap" Text="IMDB Rating" HorizontalAlignment="Left" Foreground="{StaticResource inputBoxBrush}" FontSize="{StaticResource dialogElementFontSize}" Grid.Row="1"  VerticalAlignment="Center"/>
						<TextBlock Margin="8,0,0,0" TextWrapping="Wrap" Text="Web Page" HorizontalAlignment="Left" Foreground="{StaticResource inputBoxBrush}" FontSize="{StaticResource dialogElementFontSize}" Grid.Row="2"  VerticalAlignment="Center"/>
                        <TextBox x:Name="titleTextBox" Grid.Column="1" Margin="0,0,8,0"  VerticalAlignment="Center" Style="{StaticResource HugeInputTextBoxStyle}">
                        	<TextBox.Text>
                        		<Binding Path="Title" Mode="TwoWay">
                        			<Binding.ValidationRules>
                        				<v:RequiredValidationRule ValidatesOnTargetUpdated="True"/>               			
									</Binding.ValidationRules>                		
								</Binding>                 	
							</TextBox.Text>
                        </TextBox>
						<TextBox x:Name="imdbRatingTextBox" Grid.Column="1" Margin="0,0,8,0" Grid.Row="1"  VerticalAlignment="Center" Style="{StaticResource HugeInputTextBoxStyle}">
							<TextBox.Text>
								<Binding Path="ImdbRating" Mode="TwoWay">
									<Binding.ValidationRules>
										<v:ImdbRatingValidationRule ValidatesOnTargetUpdated="True" ValidationStep="ConvertedProposedValue"/>
									</Binding.ValidationRules>
								</Binding>
							</TextBox.Text>
						</TextBox>
						<TextBox x:Name="webPageTextBox" Margin="0,0,8,0" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource HugeInputTextBoxStyle}">
							<TextBox.Text>
								<Binding Path="WebPage" Mode="TwoWay">
									<Binding.ValidationRules>
										<v:WebPageValidationRule ValidatesOnTargetUpdated="True"/>
									</Binding.ValidationRules>
								</Binding>
							</TextBox.Text>
						</TextBox>
						
						<Button Content="Ok" Grid.Column="1" Margin="0,0,8,0" Grid.Row="4" HorizontalAlignment="Right" VerticalAlignment="Center" Width="200" Height="40" Name="okButton" Click="okButton_Click" />
                    </Grid>
				</Grid>
			</Border>
		</Grid>
	</Grid>
</Page>